package com.nuc.list1;

import java.util.ArrayList;
import java.util.List;

/**
 * Time    : 2023/3/30 10:14
 * Author  : 王摇摆
 * FileName: Demo5.java
 * Software: IntelliJ IDEA 2020.2.2
 * Blog    ：https://blog.csdn.net/weixin_44943389?type=blog
 */

public class Demo5 {
    public static void main(String[] args) {
        List<String> phone = new ArrayList<>();
        phone.add("三星");
        phone.add("苹果");
        phone.add("锤子");
        phone.add("华为");
        phone.add("小米");

        System.out.print("原集合为:");
        for (String pho : phone)
            System.out.print(pho + "\t");

        phone = phone.subList(1, 4);
        System.out.print("\n子集合为:");
        for (String s : phone)
            System.out.print(s + "\t");

    }
}
